package com.rainman.simpleredis.demo.process_flow_worker;

import com.rainman.simpleredis.core.process_flow.SimpleProcessFlowWorkerInterface;
import com.rainman.simpleredis.core.process_flow.ProcessWorkerReturn;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * 流式任务执行者
 * 三方支付系统
 *
 */
@Component
public class ThirdOrderWorker implements SimpleProcessFlowWorkerInterface {


    @Override
    public ProcessWorkerReturn doWork(List<String> params) {

        System.out.println("********三方支付系统下单*******"+new Date());
        System.out.println("订单id为"+params.get(0));

        ProcessWorkerReturn dealSuc = new ProcessWorkerReturn(ProcessWorkerReturn.StateSuc,"我的三方订单系统的订单id");

        System.out.println("********三方支付系统下单完成*******"+new Date());
        return dealSuc;
    }

    @Override
    public ProcessWorkerReturn unDoWork(List<String> params, String returnInfo) {
        System.out.println("22222222三方支付系统关闭订单");
        return null;
    }

    @Override
    public String workType() {
        return "三方支付系统";
    }
}
